/**
 * 地图数据相关的方法
 */

// 展示不同depotId 对应飘线的数据

// commonLineData

var geoCoordMap = {
    '江苏': [119.991248,32.545783],
};

var GZData = [
    [{
        name: ' 南京'
    }, {
        name: '江苏',
        value: 170
    }],
];
var convertData = function (data) {
    var res = [];
    for (var i = 0; i < data.length; i++) {
        var dataItem = data[i];
        var fromCoord = geoCoordMap[dataItem[0].name];
        var toCoord = geoCoordMap[dataItem[1].name];
        if (fromCoord && toCoord) {
            res.push({
                fromName: dataItem[0].name,
                toName: dataItem[1].name,
                coords: [fromCoord, toCoord]
            });
        }
    }
    return res;
};

// 获得市级中心点 后续增加
const getCenterPoint = (depotId) => {
    let centerName
    if (depotId == 9) {
        centerName = '淮安市'
    } else if (depotId == 10) {
        centerName = '徐州市'
    } else {
        centerName = '淮安市'
    }

    return centerName
    
}

// 根据不同的仓库id，展示不同的市级中心点
// 这里展示所有仓库的信息
const HighlightLocation = storeId => {
    const storeRoomList = [
      {
        id: 7,
        addName: "上海市",
        name: "上海档案中心(上海青浦)",
        code: "SHQP",
        longitude: "121.140443",
        latitude: "31.232301",
        depotLink: "http://j.map.baidu.com/88/3PlJ",
  
        address: "【上海档案中心】上海市青浦区外青松公路3939号",
      },
      {
        id: 999,
        addName: "南京市",
        name: "窍楚技术档案中心",
        code: "QCJS",
        longitude: "118.809545",
        latitude: "31.97084",
        depotLink: "https://j.map.baidu.com/0c/GhpJ",
  
        address: "【技术档案中心】江苏省南京市江宁区富塘路18号",
      },
      {
        id: 998,
        addName: "南京市",
        name: "窍楚技术档案中心(丰树超平库测试)",
        code: "NJFSAGV",
        longitude: "118.809545",
        latitude: "31.97084",
        depotLink: "https://j.map.baidu.com/0c/GhpJ",
  
        address: "【技术档案中心】江苏省南京市江宁区滨江开发区丰树物流园",
      },
      {
        id: 997,
        addName: "南京市",
        name: "窍楚技术档案中心(方山中行)",
        code: "SAGV",
        longitude: "118.809545",
        latitude: "31.97084",
        depotLink: "https://j.map.baidu.com/0c/GhpJ",
        address: "【技术档案中心】江苏省南京市江宁区城际空间站E1",
      },
      {
        id: 996,
        addName: "南京市",
        name: "窍楚技术档案中心(方山中行)",
        code: "AGV",
        longitude: "118.809545",
        latitude: "31.97084",
        depotLink: "https://j.map.baidu.com/0c/GhpJ",
  
        address: "【技术档案中心】江苏省南京市江宁区城际空间站E1",
      },
      {
        id: 11,
        addName: "上海市",
        name: "上海档案中心(上海邮储)",
        code: "SHYC",
  
        longitude: "121.140443",
        latitude: "31.232301",
        depotLink: "http://j.map.baidu.com/88/3PlJ",
        address: "【上海档案中心】上海市青浦区外青松公路3939号",
      },
      {
        id: 10,
        addName: "徐州市",
        name: "苏北档案中心(徐州中行)",
        code: "XZZHAGV",
        longitude: "117.201199",
        latitude: "34.33465",
        depotLink: "https://j.map.baidu.com/GAa8G",
  
        address:
          "【苏北中央档案中心】徐州市鼓楼区丰树徐州智慧物流园南200米(北三环路北) ",
      },
      {
        id: 9,
        addName: "淮安市",
        name: "苏北档案中心(淮安中移)",
        code: "HAZYAGV",
        longitude: "118.574582",
        latitude: "31.830030",
        depotLink: "https://j.map.baidu.com/cb/Po8c",
  
        address:
          "【苏北档案中心】淮安市开发区承德南路333号移动呼叫基地(支撑楼西塔一楼)",
      },
      {
        id: 8,
        addName: "南京市",
        name: "NJBJ01",
        code: "NJBJ",
        longitude: "118.574582",
        latitude: "31.830030",
        depotLink: "https://j.map.baidu.com/cb/Po8c",
  
        address: "【苏皖档案中心】南京市江宁区景明大街喜燕路丰树南京滨江产业园",
      },
      {
        id: 6,
        addName: "无锡市",
        name: "苏南档案中心(无锡普洛斯)",
        code: "WXPLS",
        longitude: "120.464556",
        latitude: "31.565854",
        depotLink: "https://j.map.baidu.com/17/2Io",
  
        address: "【苏南中央档案中心】无锡市新吴区新韵北路普洛斯梅村物流园A1-U4",
      },
      {
        id: 5,
        addName: "淮安市",
        name: "杭州档案中心(杭州明浦)",
        code: "HZMP",
        longitude: "120.562306",
        latitude: "30.332625",
        depotLink: "https://j.map.baidu.com/b7/VHi",
  
        address: "【杭州档案中心】浙江省杭州市钱塘新区前进街道绿荫路98号C3号库",
      },
      {
        id: 4,
        addName: "无锡市",
        name: "苏南档案中心(无锡红木)",
        code: "WXHM",
        longitude: "120.421844",
        latitude: "31.555862",
        depotLink: "https://j.map.baidu.com/glcG2",
  
        address: "【苏南中央档案中心】无锡市新吴区长江东路2号，红木仓储有限公司",
      },
      {
        id: 3,
        addName: "无锡市",
        name: "苏南档案中心(无锡锡东)",
        code: "WXXD",
        longitude: "120.499254",
        latitude: "31.584693",
        depotLink: "https://j.map.baidu.com/QXY7G",

        address: "【苏南中央档案中心】无锡市锡山区联福路601号，锡东科技产业园",
      },
      {
        id: 2,
        addName: "南京市",
        name: "苏中档案中心(南京龙潭)",
        code: "NJLT",
        longitude: "119.084193",
        latitude: "32.215575",
        depotLink: "https://j.map.baidu.com/RwU7G",
  
        address: "【苏中中央档案中心】南京市栖霞区龙潭街道金港路8号",
      },
      {
        id: 1,
        addName: "徐州市",
        name: "苏北档案中心(徐州丰树)",
        code: "XZZH",
  
        longitude: "117.201199",
        latitude: "34.33465",
        depotLink: "https://j.map.baidu.com/GAa8G",
  
        address:
          "【苏北中央档案中心】徐州市鼓楼区丰树徐州智慧物流园南200米(北三环路北) ",
      },
      {
        id: 0,
        addName: "无锡市",
        name: "苏南档案中心(无锡中信)",
        code: "WXZX",
        longitude: "120.387329",
        latitude: "31.606373",
        depotLink: "http://j.map.baidu.com/KG_7G",
        address: "【无锡中信档案中心】无锡市锡山开发区通云南路59号",
      },
      // {
      //   id: -1,
      //   name: "未分配仓库",
      //   code: "YSQ",
      //   longitude: "0",
      //   latitude: "0",
      //   depotLink: null,
      //   address: "无",
      // },
    ];

    return storeRoomList.filter(m => m.id == storeId)[0]?.addName || '淮安市'
  };
export {
    geoCoordMap,
    GZData,
    convertData,
    getCenterPoint,
    HighlightLocation
}